# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-crcelk
pkgname=('python2-crcelk' 'python-crcelk')
_pkgname=crcelk
pkgver=1.3
pkgrel=6
pkgdesc='Updated fork of the CrcMoose module for recent versions of Python..'
arch=('any')
url='https://pypi.org/project/crcelk/#files'
license=('MIT')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('e054833e0266314a3b40d031f0149a4491078e57b30a0cec3bae7fdfba703b55bab1ebea8c78e819277e6e4776c3e767dab9d2642e524b0d4586fa1731737ec1')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-crcelk() {
  depends=('python2')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" -O1 --skip-build
}

package_python-crcelk() {
  depends=('python')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" -O1 --skip-build
}

